import 'package:demo202112/MyNavigator/wy_pagec.dart';
import 'package:demo202112/MyNavigator/wy_paged.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/**
 * @Author wywinstonwy
 * @Date 2022/1/10 9:54 下午
 * @Description:
 */

class PageA extends StatelessWidget {
  const PageA({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        height: 350,
        width: 300,
        child: Navigator(
          initialRoute: '/',
          onGenerateRoute: (RouteSettings settins) {
            WidgetBuilder builder;
            switch (settins.name) {
              case '/':
                builder = (context) => PageC();
                break;
              default:
                builder = (context) => PageD();
                break;

            }
            return MaterialPageRoute(builder: builder);
          },
        ),
      ),
    );
  }
}
